package com.chc.web.sys_paper.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chc.utils.ResultUtils;
import com.chc.utils.ResultVo;
import com.chc.web.question.entity.SysQuestion;
import com.chc.web.question.service.SysQuestionService;
import com.chc.web.sys_paper.entity.SysPaper;
import com.chc.web.sys_paper.service.SysPaperService;
import com.chc.web.sys_paper_choice.entity.SysPaperChoice;
import com.chc.web.sys_paper_choice.service.SysPaperChoiceService;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/03/31/15:22
 * @Description: 试题模块控制器
 */
@RestController
@RequestMapping("/api/syspaper")
public class SysPaperController{

    @Autowired
    private SysPaperService sysPaperService;



    /**
     * 试题保存
     * */
    @PostMapping("/savePaper")
    public ResultVo savePaper(@RequestBody List<SysPaper> paperList){
        sysPaperService.savePaper(paperList);
        return ResultUtils.success("设计试题成功");
    }

    /**
     * 编辑回显
     * */
    @GetMapping("/getPaperList")
    public ResultVo getPaperList(String questionId){
        List<SysPaper> list = sysPaperService.getList(questionId);
        return ResultUtils.success("查询试题成功",list);
    }


}
